import 'package:flutter/material.dart';
import 'package:huobi/configs/app_style_config.dart';
import 'package:huobi/views/jk/jk_text.dart';

class RegisterPage extends StatefulWidget {
  @override
  _RegisterPageState createState() => _RegisterPageState();
}

class _RegisterPageState extends State<RegisterPage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      backgroundColor: AppStyleConfig.themColor,
      appBar: AppBar(
        elevation: 0.0,
        leading: InkWell(
          onTap: () => Navigator.pop(context),
          child: Center(
            child: JKText(
              data: "取消",
            ),
          ),
        ),
      ),
      body: Container(
        padding: EdgeInsets.symmetric(horizontal: 24),
        child: Column(
          children: [
            buidHeaderWidget(),
            buildAreaWidget(),
            buildTextFieldWidget(),
          ],
        ),
      ),
    );
  }

  buidHeaderWidget() {
    return Container(
      margin: EdgeInsets.only(top: 40),
      child: Column(
        crossAxisAlignment: CrossAxisAlignment.start,
        children: [
          JKText(
            data: "手机注册",
            fontSize: 28,
            weight: FontWeight.bold,
            color: Colors.white70,
          ),
          Row(
            crossAxisAlignment: CrossAxisAlignment.center,
            children: [
              Icon(
                Icons.error_outline_sharp,
                size: 12,
                color: Colors.red,
              ),
              SizedBox(
                width: 4,
              ),
              JKText(
                data: "国家或地区注册后不能修改",
                fontSize: 12,
                color: Colors.red,
              ),
            ],
          )
        ],
      ),
    );
  }

  buildAreaWidget() {
    return Container(
      margin: EdgeInsets.only(top: 40),
      child: Row(
        children: [
          JKText(
            data: "中国",
            color: Colors.white70,
            fontSize: 17,
            weight: FontWeight.bold,
          ),
          Icon(
            Icons.arrow_drop_down_rounded,
            color: Colors.white70,
          ),
        ],
      ),
    );
  }

  buildTextFieldWidget() {
    return TextField(
      cursorColor: Colors.blue,
      showCursor: true,
      decoration: InputDecoration(
        focusColor:Colors.red,
        fillColor:Colors.blue,
        hoverColor:Colors.greenAccent,
        hintText: "手机号码",
        hintStyle: TextStyle(color: Colors.white70, fontSize: 13),
        prefixIcon: Row(
          children: [
            JKText(
              data: "+86",
              color: Colors.white70,
              fontSize: 13,
              weight: FontWeight.bold,
            ),
            Icon(
              Icons.arrow_drop_down_rounded,
              color: Colors.white70,
            ),
          ],
        ),
      ),
    );
  }
}
